<fieldset>
    <div>
        <label for="pos"><?= __('Start row:'); ?></label>
        <input type="number" name="pos" min="0" required="required"
            <?php if ($unlim_num_rows > 0) : ?>
                max="<?= ($unlim_num_rows - 1); ?>"
            <?php endif; ?>
            value="<?= htmlspecialchars($pos); ?>" />

        <label for="session_max_rows"><?= __('Number of rows:'); ?></label>
        <input type="number" name="session_max_rows" min="1"
               value="<?= htmlspecialchars($rows); ?>" required="required" />
        <input type="submit" name="submit" class="Go"
               value="<?= __('Go'); ?>" />
        <input type="hidden" name="sql_query"
               value="<?= htmlspecialchars($sql_query); ?>" />
        <input type="hidden" name="unlim_num_rows"
               value="<?= htmlspecialchars($unlim_num_rows); ?>" />
    </div>
</fieldset>